/**
 * caicongyang.com Inc.
 * Copyright (c) 2004-2017 All Rights Reserved.
 */
package com.caicongyang.design.mediator;

/**
 * 中介模式
 * @author caicongyang1
 * @version id: MediatorClientTest, v 0.1 17/5/19 下午8:18 caicongyang1 Exp $$
 */
public class MediatorClientTest {
    public static void main(String[] args) {
        ConcreteMediator mediator = new ConcreteMediator();

        ConcreteColleague1 c1 = new ConcreteColleague1(mediator);
        ConcreteColleague2 c2 = new ConcreteColleague2(mediator);

        mediator.setConcreteColleague1(c1);
        mediator.setConcreteColleague2(c2);

        c1.send("吃饭了吗？");
        c2.send("没有，你打算请客吃饭吗？");

    }

}
